package com.qingke.java.service.commandimpl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.qingke.java.pojo.User;
import com.qingke.java.service.command.SystemCommand;
import com.qingke.java.tools.QingkeConsole;
import com.qingke.java.tools.SessionManager;

public class ListCommand extends SystemCommand{

	@Override
	public void execute() {
		String selectStatement = "com.qingke.java.mapping.userMapper.getAllUsers";
		SqlSession session = SessionManager.getInstance().getSession();
		List<User> allUsers = session.selectList(selectStatement);
		
		for(User u : allUsers) {
			QingkeConsole.println(u);
		}
		session.close();
	}

}
